#ifndef __FUNC_MENU_H__
#define __FUNC_MENU_H__

	#ifdef FUNC_MENU_MAIN
	 	#define FUNC_MENU_EXT
	#else
		#define FUNC_MENU_EXT extern
	#endif
	
#include "includes.h" 
	

//************************************ 用户定义开始 ************************************//

//********************************** 用户定义结束 *************************************//

	#define T_DISP_MS 250	//250ms显示一次
		
		
	typedef struct
	{
		unsigned char step;
		unsigned char cnt;
		time_ms_T tm;
	}SELF_CHK_T;
	
	typedef struct{
		SELF_CHK_T self_chk;
		unsigned short LED_BEEP_IMG;
		unsigned char tsw;			//定时开关
		unsigned char alarm_out;	//定时开关
		unsigned char gprs_csq;
		unsigned char key_code;
		unsigned char b_disp;
		time_ms_T t_disp;
		MENU_MONO_T menu;
	}FUNC_MENU_T;
	
	#define MENU_NB_SET 3			//设定菜单号
	#define MENU_SET_TOUT 60000		//超时时间1分钟
	
	FUNC_MENU_EXT FUNC_MENU_T g_menu;

	unsigned char func_menu_init(void);
	void func_menu(FUNC_MENU_T *p);
	void func_self_chk(SELF_CHK_T *psc);
	
	typedef struct{
		CALENDAR_T g_tm_set;
		unsigned char start_set;
	}TM_SET_T;
	
	FUNC_MENU_EXT	TM_SET_T g_timer_set; //系统时间设定变量
	FUNC_MENU_EXT	TM_SET_T g_timer_set_485; //系统时间设定变量
	void TIMER_SET_INIT(void);
	
	#define page_alarm_hitch_state 6			//报警和故障界面
	#define REG_LED_BEEP	g_menu.LED_BEEP_IMG
	
	#define LED_RUN_BIT		(1<<0)
	#define LED_ALARM_BIT	(1<<1)
	#define LED_MUTE_BIT	(1<<2)
	#define LED_COMM_BIT	(1<<3)
	#define LED_HITCH_BIT	(1<<4)
	#define LED_TRIG_BIT	(1<<5)
	#define LED_BEEP_BIT	(1<<6)
	#define LED_BL_BIT		(1<<7)
	#define LED_TSW_BIT		(1<<8)
	#define LED_CLR_KEY		(1<<15)

#define B_TSW 		HWREGBITW(&(REG_LED_BEEP),8)		//
#define MENU_ALARM_HITCH_STATE_T 15
//***********************************************************************************************//	
#endif
